<template>
  <div id="leavemessage">
    <div class="main" v-for="(message,index) in leaveMsg" :key="index">
      <Row>
        <Col span="10">
          <Avatar
            shape="circle"
            icon="ios-person"
            size="large"
            class="header_size"
            :src="message.avatar"
            v-if="isStringEnpty(message.avatar)"
          />
          <Avatar
            shape="square"
            icon="ios-person"
            size="large"
            class="header_size"
            v-else
            :src="message.avatar"
          />
          <span class="name_class">{{message.name|nameFormat}}</span>
        </Col>
        <Col span="7"></Col>
        <Col span="7"></Col>
      </Row>
      <Row>
        <Col span="24">
          <span class="leaveMsgTitle name_class">{{message.Registration_reason_Title}}</span>
          {{message.Registration_reason}}
        </Col>
      </Row>
      <Row>
        <Col span="24">&nbsp</Col>
      </Row>
      <Row>
        <Col span="24">
          <span class="leaveMsgTitle name_class">{{message.Selected_lufei_Title}}</span>
          {{message.Selected_lufei}}
        </Col>
      </Row>
      <Row>
        <Col span="24">&nbsp</Col>
      </Row>
      <Row>
        <Col span="24">
          <span class="leaveMsgTitle name_class">{{message.Your_expectation_Title}}</span>
          {{message.Your_expectation}}
        </Col>
      </Row>
      <Row>
        <Col span="24">&nbsp</Col>
      </Row>
      <Row>
        <Col span="8" class="datatime">{{message.Date_time}}</Col>
        <Col span="8"></Col>
        <Col span="8"></Col>
      </Row>
    </div>
  </div>
</template>

<script>
import Vue from "vue";
import { Row, Col, Avatar } from "view-design";

Vue.filter("nameFormat", name => {
  return name.substr(0, 1) + "**";
});

export default {
  name: "leavemessage",
  components: {
    Row,
    Col,
    Avatar
  },
  props: ["leaveMsg"],
  data() {
    return {};
  },
  computed: {},
  watch: {},
  methods: {
    isStringEnpty(str) {
      if (typeof str == undefined || str == null || str == "") {
        return true;
      } else {
        return false;
      }
    }
  },
  created() {},
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {} //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>

<style scoped>
.main {
  margin: 0 20px;
  padding: 30px 0;
  border-bottom: 1px solid #e5e5e5;
  font-size: 12px;
  line-height: 24px;
  color: #000028;
}
.header_size {
  width: 50px;
  height: 50px;
  margin: 0 15px 15px 0;
}
.name_class {
  font-size: 14px;
  font-weight: 800;
  color: #606264;
}
.leaveMsgTitle {
  margin-right: 8px;
}
.datatime {
  font-size: 14px;
  color: #9d9d9d;
}
</style>